$(document).ready(function() {
	jQuery.fn.center = function () {
	    this.css("position","absolute");
	    this.css("top", (($(window).height() - this.outerHeight()) / 2) + 
	                                                $(window).scrollTop() + "px");
	    this.css("left", (($(window).width() - this.outerWidth()) / 2) + 
	                                                $(window).scrollLeft() + "px");
	    return this;
	}
	
	$("#login-box").center();
	
	$(window).resize(function() {
		$("#login-box").center();
	});
	
	$(function() {
	    $('form').each(function() {
	        $('input').keypress(function(e) {
	            // Enter pressed?
	            if(e.which == 10 || e.which == 13) {
	                this.form.submit();
	            }
	        });

	        $('input[type=submit]').hide();
	    });
	});
});